package com.metal.gear.certification.entity.dto.depart;

import com.alibaba.excel.annotation.ExcelProperty;
import com.metal.gear.certification.entity.po.SysDepart;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.beans.BeanUtils;

@Data
@Schema(name ="组织机构保存或更新实体")
public class SysDepartSaveAndEditDto {
    @Schema(name ="部门Id，departId")
    private String id;

    @Schema(name ="父机构ID")
    private String parentId;

    @ExcelProperty("机构/部门名称")
    @Schema(name ="组织机构名称")
    private String departName;

    @ExcelProperty("排序")
    @Schema(name ="组织机构排序码")
    private Integer departOrder;

    @ExcelProperty("描述")
    @Schema(name ="描述")
    private String description;

    @ExcelProperty("机构类别")
    @Schema(name ="机构类别：1=公司，2=组织机构，3=岗位")
    private String orgCategory;

    @Schema(name ="机构类型")
    private String orgType;

    @ExcelProperty("机构编码")
    @Schema(name ="机构编码")
    private String orgCode;

    @ExcelProperty("手机号")
    @Schema(name ="机构联系手机号")
    private String mobile;

    @ExcelProperty("传真")
    @Schema(name ="机构联系传真")
    private String fax;

    @ExcelProperty("地址")
    @Schema(name ="组织机构地址")
    private String address;

    @ExcelProperty("备注")
    @Schema(name ="备注")
    private String memo;

    public static SysDepart transformTo(SysDepartSaveAndEditDto dto){
        SysDepart po = new SysDepart();
        BeanUtils.copyProperties(dto,po);
        return po;
    }

}
